//
// Created by chizuru on 2025/9/2.
//

#pragma once
#include "ICommand.h"
#include "CameraDevice.h"

class RegisterReadCommand : public camera_link_bobcat::ICommand {
public:
    RegisterReadCommand(CameraDevice& comm, uint16_t addr, uint32_t* outPtr, RetryPolicy rp);
    bool execute() override ;
    // read is not modifying, undo is noop
    bool undo() override ;
    uint32_t lastValue() const ;

private:
    CameraDevice& comm;
    uint16_t addr;
    uint32_t* outPtr;
    RetryPolicy rp;
    uint32_t _lastValue{0};
};

